Next | Prev | Up | Top | Contents | Index

Summing Basic Block Count Results From Multiple Runs

Sometimes a single run of a program does not produce the results you require. You can repeatedly run the version of a program created by pixie and vary the input with each run, then use the resulting .Counts files to produce a consolidated report.

Use the following procedure to average prof results:

  1. Compile and link the input file. Do not use the -p option. For example, consider the input file myprog.c:

    % cc -o myprog myprog.c

    The cc compiler compiles myprog.c and saves the executable as myprog.

  2. Run the profiling program pixie, adding the -pids option, so that each run produces a distinct file.

    % pixie myprog -pids

    pixie generates the modified program myprog.pixie.

  3. Run the profiled program as many times as desired. The instrumented program creates a myprog.Counts.pid file with each execution and appends the process ID.

    % myprog.pixie < input1 > output1

    % myprog.pixie < input2 > output2

    % myprog.pixie < input3 > output3

  4. Create the report.

    % prof -pixie myprog myprog.Counts*

    prof sums the basic block data in the .Counts files to produce the profile report.


Next | Prev | Up | Top | Contents | Index